$(".fabuboke").click((e) => {
    var conut
    $.ajax({
        type: "GET",
        url: "/getboke",
        success: (data) => {
            conut = data.data.rows.length + 1
            var fenlei;
            const tit = $(".biaotitext").val()
            for (i = 0; i < $(".fenleiinput").length; i++) {
                if ($(".fenleiinput").eq(i).prop("checked")) {
                    fenlei = $(".fenleiinput").eq(i).parent().text()
                }
            }
            const text = $(".w-e-text").text()
            var date = new Date();
            var y = date.getFullYear(); //获取年份
            var m = (date.getMonth() + 1) < 10 ? ('0' + (date.getMonth() + 1)) : (date.getMonth() + 1); //获取月份
            var d = date.getDate() < 10 ? ('0' + date.getDate()) : date.getDate(); //获取天
            var s = date.toLocaleTimeString();

            date = y + "-" + m + "-" + d + "-" + s; //获取当前时间
            const yuedu = 0
            $.ajax({
                type: "POST",
                url: "/getboke/addBoke",
                data: {
                    tit,
                    text,
                    fenlei,
                    date,
                    yuedu,
                    conut
                },
                success: (data) => {
                    $(".biaotitext").val("")
                    $(".fenleiinput").prop("checked") == false
                    $(".w-e-text").text("")
                }
            })
        }
    })
})
$.ajax({
    type: "GET",
    url: "/getboke/getReading",
    success: (data) => {
        const obj = data.data
        for (let i = 0; i < obj.length; i++) {
            $(".ex_menu").append(`
            <li class="cebianli"><a href="/html/xq.html?id=${obj[i].id}">${obj[i].Boketit}</br>${obj[i].Reading}阅读量</a><br />
            </li>
          `)
        }
    }
})